﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SecurityApi.DataAccess
{
    public class ApplicationAttributeRepository : BaseRepository
    {
        //TODO: Implement this
        public int AddAttribute(string enterpriseName)
        {
            int attributeId = -1;
            return attributeId;
        }

        //TODO: Implement this
        public bool RemoveAttribute(string name)
        {
            bool bResult = true;
            return bResult;
        }

        public string GetApplicationAttribute(int applicationId,string key)
        {
            key = key.Trim();

            string attribute = _context.ApplicationAttributes.Where(p => p.ApplicationId == applicationId && p.Key.Equals(key)).Select(x=>x.Value).SingleOrDefault();
            return attribute;
        }

    }
}
